/**
 * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

.cart-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

.cart-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4CAF50;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: transform 0.3s ease, background-color 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-button:hover {
  transform: scale(1.05);
  background-color: #45a049;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #e91e63;
  color: white;
  font-size: 14px;
  font-weight: bold;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-popover {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 350px;
  max-height: 500px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
}

.cart-header h2 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.cart-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #777;
}

.cart-close:hover {
  color: #000;
}

.cart-items {
  overflow-y: auto;
  padding: 10px;
  max-height: 300px;
}

.cart-item {
  display: flex;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cart-item-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 15px;
  cursor: pointer;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #333;
}

.cart-item-price {
  margin: 0 0 5px 0;
  font-weight: bold;
  color: #e91e63;
}

.cart-item-quantity {
  margin: 0 0 8px 0;
  color: #555;
  font-size: 14px;
}

.cart-item-remove {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.cart-item-remove:hover {
  background-color: #d32f2f;
}

.cart-footer {
  padding: 15px;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 16px;
}

.place-order-in-cart {
  width: 100%;
  padding: 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 10px;
}

.place-order-in-cart:hover {
  background-color: #45a049;
}

.place-order-in-cart:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.cart-checkout {
  width: 100%;
  padding: 10px;
  background-color: #2196F3;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.cart-checkout:hover {
  background-color: #0b7dda;
}

.cart-empty {
  padding: 30px 15px;
  text-align: center;
  color: #777;
}

.cart-empty p {
  margin-bottom: 15px;
}

.cart-browse-products {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.cart-browse-products:hover {
  background-color: #45a049;
}

.cart-loading {
  padding: 30px 15px;
  text-align: center;
  color: #777;
}

@media (max-width: 480px) {
  .cart-popover {
    width: 300px;
    right: -10px;
  }
}